package com.wordpress.felipecosse;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Menu extends ListActivity{
	final String[] aplicacao = new String[] {"PrimeiroExemplo", "ExemploAPI", "Sair"};
	
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		this.setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, aplicacao));
	}
	
	@Override
	public void onListItemClick(ListView l, View v, int position, long id){
		switch(position){
		case 0: startActivity(new Intent(this, PrimeiroExemplo.class));
			break;
		case 1: startActivity(new Intent(this, ExemploAPI.class));
			break;
		default: finish(); 
	}
	}
}
